<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>digichef.tagging.models.TagManager</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="digichef-module.html">Package&nbsp;digichef</a> ::
        <a href="digichef.tagging-module.html">Package&nbsp;tagging</a> ::
        <a href="digichef.tagging.models-module.html">Module&nbsp;models</a> ::
        Class&nbsp;TagManager
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="digichef.tagging.models.TagManager-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class TagManager</h1><p class="nomargin-top"><span class="codelink"><a href="digichef.tagging.models-pysrc.html#TagManager">source&nbsp;code</a></span></p>
<center>
<center>  <map id="uml_class_diagram_for_digichef_49" name="uml_class_diagram_for_digichef_49">
<area shape="rect" href="digichef.tagging.models.TagManager-class.html#update_tags" title="Update tags associated with an object." alt="" coords="17,36,593,55"/>
<area shape="rect" href="digichef.tagging.models.TagManager-class.html#add_tag" title="Associates the given object with a tag." alt="" coords="17,55,593,73"/>
<area shape="rect" href="digichef.tagging.models.TagManager-class.html#get_for_object" title="Create a queryset matching all tags associated with the given object." alt="" coords="17,73,593,92"/>
<area shape="rect" href="digichef.tagging.models.TagManager-class.html#usage_for_model" title="Obtain a list of tags associated with instances of the given Model class." alt="" coords="17,92,593,111"/>
<area shape="rect" href="digichef.tagging.models.TagManager-class.html#usage_for_queryset" title="Obtain a list of tags associated with instances of a model contained in the given queryset." alt="" coords="17,111,593,129"/>
<area shape="rect" href="digichef.tagging.models.TagManager-class.html#related_for_model" title="Obtain a list of tags related to a given list of tags &#45; that is, other tags used by items which have all the given tags." alt="" coords="17,129,593,148"/>
<area shape="rect" href="digichef.tagging.models.TagManager-class.html#cloud_for_model" title="Obtain a list of tags associated with instances of the given Model, giving each tag a ``count`` attribute indicating how many times it has been used and a ``font_size`` attribute for use in displaying a tag cloud." alt="" coords="17,148,593,167"/>
<area shape="rect" href="digichef.tagging.models.TagManager-class.html" title="digichef.tagging.models.TagManager" alt="" coords="16,11,595,168"/>
</map>
  <img src="uml_class_diagram_for_digichef_49.gif" alt='' usemap="#uml_class_diagram_for_digichef_49" ismap="ismap" class="graph-without-title" />
</center>
</center>
<hr />
<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="update_tags"></a><span class="summary-sig-name">update_tags</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">obj</span>,
        <span class="summary-sig-arg">tag_names</span>)</span><br />
      Update tags associated with an object.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="digichef.tagging.models-pysrc.html#TagManager.update_tags">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="add_tag"></a><span class="summary-sig-name">add_tag</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">obj</span>,
        <span class="summary-sig-arg">tag_name</span>)</span><br />
      Associates the given object with a tag.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="digichef.tagging.models-pysrc.html#TagManager.add_tag">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="get_for_object"></a><span class="summary-sig-name">get_for_object</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">obj</span>)</span><br />
      Create a queryset matching all tags associated with the given
object.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="digichef.tagging.models-pysrc.html#TagManager.get_for_object">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="_get_usage"></a><span class="summary-sig-name">_get_usage</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">model</span>,
        <span class="summary-sig-arg">counts</span>=<span class="summary-sig-default">False</span>,
        <span class="summary-sig-arg">min_count</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">extra_joins</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">extra_criteria</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">params</span>=<span class="summary-sig-default">None</span>)</span><br />
      Perform the custom SQL query for ``usage_for_model`` and
``usage_for_queryset``.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="digichef.tagging.models-pysrc.html#TagManager._get_usage">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="digichef.tagging.models.TagManager-class.html#usage_for_model" class="summary-sig-name">usage_for_model</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">model</span>,
        <span class="summary-sig-arg">counts</span>=<span class="summary-sig-default">False</span>,
        <span class="summary-sig-arg">min_count</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">filters</span>=<span class="summary-sig-default">None</span>)</span><br />
      Obtain a list of tags associated with instances of the given
Model class.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="digichef.tagging.models-pysrc.html#TagManager.usage_for_model">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="digichef.tagging.models.TagManager-class.html#usage_for_queryset" class="summary-sig-name">usage_for_queryset</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">queryset</span>,
        <span class="summary-sig-arg">counts</span>=<span class="summary-sig-default">False</span>,
        <span class="summary-sig-arg">min_count</span>=<span class="summary-sig-default">None</span>)</span><br />
      Obtain a list of tags associated with instances of a model
contained in the given queryset.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="digichef.tagging.models-pysrc.html#TagManager.usage_for_queryset">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="digichef.tagging.models.TagManager-class.html#related_for_model" class="summary-sig-name">related_for_model</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">tags</span>,
        <span class="summary-sig-arg">model</span>,
        <span class="summary-sig-arg">counts</span>=<span class="summary-sig-default">False</span>,
        <span class="summary-sig-arg">min_count</span>=<span class="summary-sig-default">None</span>)</span><br />
      Obtain a list of tags related to a given list of tags - that
is, other tags used by items which have all the given tags.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="digichef.tagging.models-pysrc.html#TagManager.related_for_model">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="digichef.tagging.models.TagManager-class.html#cloud_for_model" class="summary-sig-name">cloud_for_model</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">model</span>,
        <span class="summary-sig-arg">steps</span>=<span class="summary-sig-default">4</span>,
        <span class="summary-sig-arg">distribution</span>=<span class="summary-sig-default">LOGARITHMIC</span>,
        <span class="summary-sig-arg">filters</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">min_count</span>=<span class="summary-sig-default">None</span>)</span><br />
      Obtain a list of tags associated with instances of the given
Model, giving each tag a ``count`` attribute indicating how
many times it has been used and a ``font_size`` attribute for
use in displaying a tag cloud.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="digichef.tagging.models-pysrc.html#TagManager.cloud_for_model">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Method Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-MethodDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="usage_for_model"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">usage_for_model</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">model</span>,
        <span class="sig-arg">counts</span>=<span class="sig-default">False</span>,
        <span class="sig-arg">min_count</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">filters</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="digichef.tagging.models-pysrc.html#TagManager.usage_for_model">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">

Obtain a list of tags associated with instances of the given
Model class.

If ``counts`` is True, a ``count`` attribute will be added to
each tag, indicating how many times it has been used against
the Model class in question.

If ``min_count`` is given, only tags which have a ``count``
greater than or equal to ``min_count`` will be returned.
Passing a value for ``min_count`` implies ``counts=True``.

To limit the tags (and counts, if specified) returned to those
used by a subset of the Model's instances, pass a dictionary
of field lookups to be applied to the given Model as the
``filters`` argument.

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="usage_for_queryset"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">usage_for_queryset</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">queryset</span>,
        <span class="sig-arg">counts</span>=<span class="sig-default">False</span>,
        <span class="sig-arg">min_count</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="digichef.tagging.models-pysrc.html#TagManager.usage_for_queryset">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">

Obtain a list of tags associated with instances of a model
contained in the given queryset.

If ``counts`` is True, a ``count`` attribute will be added to
each tag, indicating how many times it has been used against
the Model class in question.

If ``min_count`` is given, only tags which have a ``count``
greater than or equal to ``min_count`` will be returned.
Passing a value for ``min_count`` implies ``counts=True``.

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="related_for_model"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">related_for_model</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">tags</span>,
        <span class="sig-arg">model</span>,
        <span class="sig-arg">counts</span>=<span class="sig-default">False</span>,
        <span class="sig-arg">min_count</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="digichef.tagging.models-pysrc.html#TagManager.related_for_model">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">

Obtain a list of tags related to a given list of tags - that
is, other tags used by items which have all the given tags.

If ``counts`` is True, a ``count`` attribute will be added to
each tag, indicating the number of items which have it in
addition to the given list of tags.

If ``min_count`` is given, only tags which have a ``count``
greater than or equal to ``min_count`` will be returned.
Passing a value for ``min_count`` implies ``counts=True``.

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="cloud_for_model"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">cloud_for_model</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">model</span>,
        <span class="sig-arg">steps</span>=<span class="sig-default">4</span>,
        <span class="sig-arg">distribution</span>=<span class="sig-default">LOGARITHMIC</span>,
        <span class="sig-arg">filters</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">min_count</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="digichef.tagging.models-pysrc.html#TagManager.cloud_for_model">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">

Obtain a list of tags associated with instances of the given
Model, giving each tag a ``count`` attribute indicating how
many times it has been used and a ``font_size`` attribute for
use in displaying a tag cloud.

``steps`` defines the range of font sizes - ``font_size`` will
be an integer between 1 and ``steps`` (inclusive).

``distribution`` defines the type of font size distribution
algorithm which will be used - logarithmic or linear. It must
be either ``tagging.utils.LOGARITHMIC`` or
``tagging.utils.LINEAR``.

To limit the tags displayed in the cloud to those associated
with a subset of the Model's instances, pass a dictionary of
field lookups to be applied to the given Model as the
``filters`` argument.

To limit the tags displayed in the cloud to those with a
``count`` greater than or equal to ``min_count``, pass a value
for the ``min_count`` argument.

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Thu Apr  1 02:28:26 2010
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
